package org.jeecg.modules.project.controller;

import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.gpt.vo.ChatHistoryVO;
import org.jeecg.modules.project.service.LoginService;
import org.jeecg.modules.project.vo.LoginDto;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * @author Mr.Liu
 * @date 2024/05/14
 * @Description
 */
@Slf4j
@RestController
@RequestMapping("/sys/user")
public class LoginController {

    @Resource
    private LoginService loginService;

    @RequestMapping(value = "/login", method = RequestMethod.POST)
    @ResponseBody
    public Result<?> login(@RequestBody LoginDto loginDto, HttpServletResponse response) {
        return Result.ok(loginService.login(loginDto,response));
    }

}
